#include<iostream>
#include<string>
using namespace std;
class Solution {
public:
    int firstUniqChar(string s) {
        for (int i = 0; i < s.size(); i++) {
            int j = i + 1;
            int t = 0;
            if (s[i] != '0') {
                for (j; j < s.size(); j++) {
                    if (s[i] == s[j]) {
                        s[j] = '0';
                        t = t + 1;
                    }
                }
                if (t == 0) {
                    return i;
                }
            }
        }
        return -1;
    }
};


